//
//  ZBPickerView.h
//  ZBTechniqueLibrary
//
//  Created by apple on 2018/9/30.
//  Copyright © 2018年 apple. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ZBPickerConfig.h"
@class ZBPickerView;

@protocol ZBPickerViewDataSource <NSObject>

//多少列
- (NSInteger)zb_numberOfComponentsInPickerView:(ZBPickerView *)pickerView;

//每列多少行
- (NSInteger)zb_pickerView:(ZBPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;

//每列显示文字
- (NSString *)zb_pickerView:(ZBPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;

@end

@protocol ZBPickerViewDelegate <NSObject>

//选择某行某列表
- (void)zb_pickerView:(ZBPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
@end


typedef void(^selectBlock)(NSInteger row, NSInteger component, NSString *selectString);
@interface ZBPickerView : UIView

- (instancetype)initWithConfig:(ZBPickerConfig *)config;

@property (nonatomic, weak) id <ZBPickerViewDataSource>dataSouce;

@property (nonatomic, weak) id <ZBPickerViewDelegate>delegate;

//显示pickerView
- (void)showPickerViewWithDidSelect:(selectBlock)compeletion;

- (void)showPickerViewInView:(UIView *)superView handledidSelect:(selectBlock)compeletion;


//快速创建
+ (void)showPickerViewDefaultConfigWithType:(ZBPickerValueType)type compeletion:(selectBlock)compeletion;

+ (void)showPickerViewWithconfig:(ZBPickerConfig *)config type:(ZBPickerValueType)type compeletion:(selectBlock)compeletion;

+ (void)showPickerViewWithInView:(UIView *)superView config:(ZBPickerConfig *)config type:(ZBPickerValueType)type compeletion:(selectBlock)compeletion;
@end
